<!DOCTYPE html>
<html>
    <head>
        <!--        <meta charset="utf-8">
                <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, maximum-scale=1">
                <meta name="author" content="Sergey Pimenov">
                <meta name="keywords" content="windows 8, modern style, Metro UI, style, modern, css, framework">-->

        <link href="css/modern.css" rel="stylesheet">
        <link href="css/modern-responsive.css" rel="stylesheet">
        <link href="css/site.css" rel="stylesheet" type="text/css">

        <script type="text/javascript" src="js/assets/jquery.js"></script>

        <script type="text/javascript" src="js/assets/jquery.mousewheel.min.js"></script>
        <script type="text/javascript" src="js/assets/moment.js"></script>
        <script type="text/javascript" src="js/assets/moment_langs.js"></script>

<!--        <script type="text/javascript" src="js/modern/dropdown.js"></script>
        <script type="text/javascript" src="js/modern/accordion.js"></script>
        <script type="text/javascript" src="js/modern/buttonset.js"></script>
        <script type="text/javascript" src="js/modern/carousel.js"></script>
        <script type="text/javascript" src="js/modern/input-control.js"></script>
        <script type="text/javascript" src="js/modern/pagecontrol.js"></script>
        <script type="text/javascript" src="js/modern/rating.js"></script>
        <script type="text/javascript" src="js/modern/slider.js"></script>
        <script type="text/javascript" src="js/modern/tile-slider.js"></script>
        <script type="text/javascript" src="js/modern/tile-drag.js"></script>
        <script type="text/javascript" src="js/modern/calendar.js"></script>
        
        <script type="text/javascript" src="js/modern/sis-j.js"></script>-->
        <script type="text/javascript" src="js/assets/AjaxConnect.js"></script>
        <script type="text/javascript" src="js/modern/dialog.js"></script>

        <title>Study Planner</title>

        <script>    
            function submitfunction(){
                var p;
                var Uname = document.getElementById("idUserName").value;
                var Upwd = document.getElementById("idPassword").value; 
                if(Uname == "" || Upwd == ""){
                    $(document).ready(function(){
                        $.Dialog({
                            'title' : 'Login Failed',
                            'content' : 'You must enter the Usename and Password',
                            'draggable' : true,
                            'overlay' : true,
                            'closeButton' : true,
                            'buttonsAlign': 'center',
                            'keepOpened' : true,
                            'buttons' : {
                                'Ok' : {
                                    'action': function(){}
                                }
                            }
                        });
                    });
                    p = document.createElement('div');		
                    if(Uname == ""){
                        p.innerHTML = "please enter your email";
                        errorMessage.appendChild(p);
                    }
                    if(Upwd == ""){
                        p.innerHTML = "please enter your password";
                        errorMessage.appendChild(p);
                    }
                }
                else
                {var json='{"UseName" : "'+Uname+ '","Password" : "'+ Upwd+'"}';
                    var xmlhttp=ajaxFunction( "testrun2.php",json,"POST");
                    if(xmlhttp.readyState==4 && xmlhttp.status==200)
                    {
                        if( xmlhttp.responseText.trim() == '0')
                        {
                            window.location.href = "indexN.php";			
                        }
	
                    }
                }
            }
        </script>

    </head>
    <body class="metrouicss">
        <div class="nav-bar">
            <div style="width: 940px; margin: auto;">
                <div class="nav-bar-inner padding5" style="float: left;">
                    <div class="clearfix">
                        <div class="span5" style="float: left;">
                            <a href="/"><span class="element brand">
                                    <img class="place-left" src="images/logo.png" style="height: 40px;"/>
                                    Study Planner
                                </span></a>
                            <div class="divider"></div>
                        </div>
                        <div class="no-border-all span6 place-right">
                            <form action="" method="post">
                                <table style="border-collapse: collapse; border: 0; border-top: 0; border-bottom: 0; border-left: 0; border-right: 0;">
                                    <tr style="border-bottom: 0; border-right: 0;">
                                        <td style="border-bottom: 0; border-right: 0;"><label class="fg-color-white">E mail</label></td>
                                        <td style="border-bottom: 0; border-right: 0;"><label class="fg-color-white">Password</label></td>
                                    </tr>
                                    <tr style="border-bottom: 0; border-right: 0;">
                                        <td style="border-bottom: 0;"><input class="input-control text" id ="idUserName" type="text" name="username" value="" /></td>
                                        <td style="border-bottom: 0;"><input class="input-control text" id ="idPassword" type="password" name="password" value="" /></td>
                                        <td style="border-bottom: 0; border-top: 0; "><input class="button mini" type="button" value ="Login" onclick ="submitfunction()"/></td>
                                    </tr>
                                </table>
                            </form>
                        </div>    
                    </div>
                </div>
            </div>
        </div>
        <div class="page">
        </div>
        <div class="page">
            <!-- include sidebar.php if needed -->
            <div class="page snapped">
            </div>
            <div class="page fill">
                <div class="page-region">
                    <div class="page-region-content">
                        <div class="grid">
                            <div class="row">
                                <div class="span4" style="margin-left: 350px;">
                                    <h1>Sign Up</h1>
                                    <div Class="span4 fg-color-blueDark">
                                        <p class="text-right">Sign up for free</p>
                                    </div>
                                    <form id="signUp-form" method="post" action="signedup.php">
                                        <div class="input-control text span4">
                                            <p>First Name</p>
                                            <input class="with-helper border-color-blueDark" name="first-name" id="first-name" type="text" autofocus=""/>
                                        </div>                        
                                        <div class="input-control text span4">
                                            <p>Last Name</p>
                                            <input class="with-helper border-color-blueDark" name="last-name" id="last-name" type="text" autofocus=""/>
                                        </div>
                                        <div class="input-control text span4">
                                            <p>User Name</p>
                                            <input class="with-helper border-color-blueDark" name="user-name" id="user-name" type="text" autofocus="">
                                        </div>
                                        <div class="input-control text span4">
                                            <p>E-mail</p>
                                            <input class="with-helper border-color-blueDark" name="e-mail" id="e-mail" type="text" autofocus="">
                                        </div>
                                        <div class="input-control password- span4">
                                            <p>Password</p>
                                            <input class="border-color-blueDark" name="password" id="password" type="password" autofocus="">
                                        </div>
                                        <div class="input-control text span4">
                                            <p>Confirm Password</p>
                                            <input class="with-helper border-color-blueDark" name="confirm-password" id="confirm-password" type="password" autofocus="">
                                        </div>
                                        <div class="span4">
                                            <input type="submit" value="Sign Up" class="button bg-color-blue fg-color-white" name="signUp-button" id="signUp-button" onclick="signUp()">
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--    <div class="page">  -->
        <div class="nav-bar">
            <div class="nav-bar-inner padding5">
                <span class="element">
                    2013, Study Planner &copy; by <a class="fg-color-white" href="mailto:sergey@pimenov.com.ua">Freak eYe</a>
                </span>
            </div>
        </div>
        <!--  </div> -->

        <script type="text/javascript" src="js/assets/github.info.js"></script>
        <script type="text/javascript" src="js/assets/google-analytics.js"></script>
        <script type="text/javascript" src="js/google-code-prettify/prettify.js"></script>
        <script src="js/sharrre/jquery.sharrre-1.3.4.min.js"></script>

        <script>
            $('#shareme').sharrre({
                share: {
                    googlePlus: true
                    ,facebook: true
                    ,twitter: true
                    ,delicious: true
                },
                urlCurl: "js/sharrre/sharrre.php",
                buttons: {
                    googlePlus: {size: 'tall'},
                    facebook: {layout: 'box_count'},
                    twitter: {count: 'vertical'},
                    delicious: {size: 'tall'}
                },
                hover: function(api, options){
                    $(api.element).find('.buttons').show();
                }
            });
        </script>

    </body>
</html>